A connector formed in two pieces is known in principle. While the male part inserted into the socket portion is provided for contacting a plug contact inserted into the socket portion, the female part is typically configured such that the connector may be connected to an electrical wire. Thus, the electrical path from the wire to the plug contact leads through the female part and the male part. In the known connector, the male part and the female part are welded together for establishing an improved electrical and mechanical connection. The welded joint may be formed, e.g. by a laser welding method, to be point-like at various locations. The connector may then be connected with an electrical conductor, e.g. an electric wire. When assembling connectors to electrical wires, often ultrasonic-based connecting techniques are used. However, the connector, having been improved by means of welded joints, is sensitive to vibrations. The welding points may break due to the vibrations which occur during ultrasonic welding and also continue to the welding points at the connector. The breaking of the welding points cannot be predicted and changes the electrical and mechanical characteristics of the connector. This renders it impossible to maintain standards of quality when assembling wires.